<?php
  if(cmd("join",30)) chan_join($msg_args[1]);
  if(cmd("part",30)) chan_part($msg_args[1], (count($msg_args) >= 3) ? $msg_params2 : 'Leaving');
  if(cmd("cycle",30)) {
    chan_part($msg_args[1], 'Cycling');
    chan_join($msg_args[1]);
  }
  if(cmd("quit",50)) {
		quit((count($msg_args) >= 2) ? $msg_params : 'Woof Woof!');
    die();
  }
  if(cmd("raw",50)) send($msg_params);
  if(cmd("network",50)){
    $network=$msg_params;
    $port=6667;
    if(stristr($network,":")){
      $networkA=explode(":",$network);
      $network=$networkA[0];
      $port=(int)$networkA[1];
    }
    quit("Off to $network...");
  }
  if(cmd("memory")) msg('Currently using ' . memUsed() . ' of memory.');
?>